The invention relates to an electric device, designed to be attached to a mounting rail, and a corresponding mounting method.